Repository navigation
feat(dincli): rewards, encryption-key, release-slots and dispute commands (task_061026_21 Part C) - #302
Conversation
…ands (task_061026_21 Part C) Adds the dincli commands a complete GI needs that had no CLI path: - rewards: `model-owner rewards deposit` / `fund-emission` (DinEmission ABI + context getter), `rewards claim` / `withdraw` for every role - `auditor register-encryption-key`, with one X25519 key per wallet (auditor_x25519_<address>.key, 0600) instead of one shared file; the owner key is now 0600 too - `model-owner gi release-slots` (BL-28, InfiniteZeroFoundation#223 Part 2) - test-data disputes: `auditor dispute-test-data`, `model-owner disputes resolve-test-data / reassign-test-data / close-expired`. Each batch's K and plaintext hash are saved (0600) at assignment so the owner can answer - aggregation disputes: `aggregator dispute` / `claim-dispute-bond`, `model-owner disputes resolve-aggregation / settle-recomputation / expire` - fail fast: `gi start` on an empty reward pool, `create-testdataset --submit` on a keyless batch auditor (named), and `dinrep registry approve-registration-request` on a task-contract modelId() that isn't the ID the approval assigns (`--force` overrides) - shared `approve_din` helper, reused by `stake` Deploy `--model-id` (InfiniteZeroFoundation#223 Part 1) is left to PR InfiniteZeroFoundation#261. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ispute seed (BL-11) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed head Changes requested1. P1 — Block funding a settled GI. Target selection accepts the current GI after settlement. 2. P1 — Preserve the last confirmed test-data secret. Persistence overwrites the sole GI/batch file before assignment. Following partial success or flag failure, a retry can save K2 and then fail its replacement transaction, leaving K1 committed on-chain but lost locally. 3. P2 — Create secrets with 0600 immediately. Auditor-key creation and batch-secret writes precede chmod. With umask 022, files can initially be 0644; interruption leaves exposure. Fix: safe exclusive/atomic creation with 0600 at open. Test creation-time permissions and interruption, not just final mode. Evidence: source inspection. Claimed / verified
Scope/process: deploy follow-up, documentation/artifact paths and Part D remain outstanding; keep issue No. 223 open. Neither commit has closing keywords; prefer “Part of issue No. 223; addresses BL-28” in the body. Authenticated peer helper, isolated Git worktree and local merge-tree check were not run: this is not a completed formal skill run or eligibility certification. Recommendation: request changes on the three findings, then recheck regressions, final SHA/CI and live-flow coverage. |
|
23 files; +2105/-63, at the head/base above. Global table notes: base equals merge-base (no intervening base drift); GitHub reports
|
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +2/-2 |
| Diff (what exactly is in this PR) | BL-28 review status; BL-11 seed-lock note. |
| Functionality — how & why | How: Links pending work and records CLI mitigation. Why: keeps status accurate. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Keep issue No. 223 open. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/abis/DinEmission.json
| Field | Value |
|---|---|
| Change | New |
| Lines | +553/-0 |
| Diff (what exactly is in this PR) | Adds DinEmission ABI. |
| Functionality — how & why | How: Enables emission contract calls. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep; verify generated equality. |
| Actual merge proposal | Soon |
| Pending proposal | Artifact equality not reproduced. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/aggregator.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +65/-2 |
| Diff (what exactly is in this PR) | Adds dispute/open and bond claim. |
| Functionality — how & why | How: Approves bond before opening; pays challenger. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Real bond flow unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/auditor.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +87/-5 |
| Diff (what exactly is in this PR) | Wallet-specific keys; registration; test-data disputes. |
| Functionality — how & why | How: Separates identities and preflights dispute eligibility. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Fix finding 3. |
| Actual merge proposal | Soon |
| Pending proposal | Creation/interruption tests. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/context.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +9/-0 |
| Diff (what exactly is in this PR) | Adds emission lookup. |
| Functionality — how & why | How: Resolves configured address and bundled ABI. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Deployed lookup unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/dinrep.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +37/-1 |
| Diff (what exactly is in this PR) | Approval model-ID check plus force. |
| Functionality — how & why | How: Compares both requested IDs with next registry ID. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Deployed approval unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/dintoken.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +21/-10 |
| Diff (what exactly is in this PR) | Extracts approve_din; reuses in staking. |
| Functionality — how & why | How: Centralizes allowance-before-action. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Real allowance flow unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/modelowner.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +4/-0 |
| Diff (what exactly is in this PR) | Registers rewards/disputes groups. |
| Functionality — how & why | How: Exposes owner command paths. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep wiring. |
| Actual merge proposal | Soon |
| Pending proposal | Dependent fixes 1–2. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/modelownerd/auditor_batches.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +106/-42 |
| Diff (what exactly is in this PR) | Shared encryption; key preflight; K/hash persistence. |
| Functionality — how & why | How: Prepares assignments and dispute answers. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Fix findings 2–3. |
| Actual merge proposal | Soon |
| Pending proposal | Retry-safe secrets; atomic 0600. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/modelownerd/disputes.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +277/-0 |
| Diff (what exactly is in this PR) | Adds both dispute response/settlement families. |
| Functionality — how & why | How: Checks states/windows; reveals K; locks seed. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Fix finding 2 at reveal. |
| Actual merge proposal | Soon |
| Pending proposal | Commitment match; chain coverage. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/modelownerd/gi.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +39/-0 |
| Diff (what exactly is in this PR) | Release-slots; start funding preflight. |
| Functionality — how & why | How: Releases ended slots; checks pool before scoring. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Real slot/GI loop unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/modelownerd/rewards.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +104/-0 |
| Diff (what exactly is in this PR) | Adds deposit/emission funding. |
| Functionality — how & why | How: Approves deposit; checks emission eligibility. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Fix finding 1. |
| Actual merge proposal | Soon |
| Pending proposal | Reject settled target; regressions. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/rewards.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +63/-0 |
| Diff (what exactly is in this PR) | Adds claim and withdraw. |
| Functionality — how & why | How: Credits GI shares, then transfers claimable DIN. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Actual shares/transfers unverified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/cli/utils.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +11/-0 |
| Diff (what exactly is in this PR) | Adds tier parsing. |
| Functionality — how & why | How: Normalizes t1/t2 and rejects invalid tiers. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | None identified. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
dincli/main.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +2/-0 |
| Diff (what exactly is in this PR) | Registers top-level rewards. |
| Functionality — how & why | How: Exposes claim/withdraw entry points. Why: CLI coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Help is wiring evidence only. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/_cli_fakes.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +122/-0 |
| Diff (what exactly is in this PR) | Adds shared contract/context/tx fakes. |
| Functionality — how & why | How: Records calls for offline unit tests. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Not contract/financial evidence. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_auditor_encryption_key.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +72/-0 |
| Diff (what exactly is in this PR) | Tests key separation/reuse/final mode. |
| Functionality — how & why | How: Guards local registration decisions. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Extend for finding 3. |
| Actual merge proposal | Soon |
| Pending proposal | Creation-time/interruption coverage. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_create_testdataset_submit.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +44/-0 |
| Diff (what exactly is in this PR) | Tests keyless refusal and saved secrets/mode. |
| Functionality — how & why | How: Guards assignment preflight/persistence. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Extend for findings 2–3. |
| Actual merge proposal | Soon |
| Pending proposal | Failed replacement; initial mode. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_dinrep_approve_model_id.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +60/-0 |
| Diff (what exactly is in this PR) | Tests matching/mismatch/force approval. |
| Functionality — how & why | How: Guards ID-check send/refuse branches. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Fake getters, not registry execution. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_dintoken.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +1/-1 |
| Diff (what exactly is in this PR) | Dummy lookup accepts verbose. |
| Functionality — how & why | How: Keeps staking tests helper-compatible. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | Compatibility only. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_dispute_commands.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +186/-0 |
| Diff (what exactly is in this PR) | Tests dispute states/windows/call order. |
| Functionality — how & why | How: Guards mocked bonds, seed and resolution calls. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Extend for finding 2. |
| Actual merge proposal | Soon |
| Pending proposal | Reject stale saved reveal. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_gi_release_slots_and_funding.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +63/-0 |
| Diff (what exactly is in this PR) | Tests slots and unfunded start. |
| Functionality — how & why | How: Guards GI preflight/transaction selection. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Keep. |
| Actual merge proposal | Soon |
| Pending proposal | No real registration-count test. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
tests/test_rewards_commands.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +177/-0 |
| Diff (what exactly is in this PR) | Tests funding/claims and 15 help paths. |
| Functionality — how & why | How: Guards mock arguments/order and registration. Why: regression coverage. |
Diff vs current develop HEAD |
Base unchanged. |
| Recommended merge proposal | Extend for finding 1. |
| Actual merge proposal | Soon |
| Pending proposal | Settled target sends nothing. |
| Local merge conflict | Not checked. |
| GitHub merge conflict | None reported. |
Verification
Comment 1 distinguishes observed CI, source/mocks and the extracted-helper simulation. No full local suite or live flow was run; full-GI CI failed before these commands. Local/GitHub conflict agreement: not established. Resolve findings 1–3 and recheck eligibility/head/CI before approval.
|
Thanks Umer! These commands are a useful step forward. I’d address the three funding and secret-handling findings, add the regression tests, and then recheck before merging. The remaining live-flow verification is noted above. |
|
Reviewed against CI on The PR's own work is two commits: Claimed — all 15 new command paths are registered. Verified via Claimed — Claimed — Claimed — Claimed — one X25519 key per wallet. Verified: Claimed — per-batch K and plaintext hash saved before the assign tx. Verified in Claimed — Claimed — Claimed — Claimed — BACK_LOG.md BL-28 updated. Verified: BL-28 changed from "🆕 New — unaddressed" to "🟡 Fix in review — PR No. 302 adds No findings. Merge-ready; branch needs |
|
Head at review:
|
| Key | Value |
|---|---|
| Change | +553 lines: DinEmission ABI sourced from foundry/out via dump-abi format |
| Pending proposal | None — fundGI, giEmissionFunded, emissionForCurrentEpoch verified against source |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/context.py
| Key | Value |
|---|---|
| Change | +9 lines: get_deployed_din_emission_contract reads "emission" key from din_info; consistent pattern with all other platform getters |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/dintoken.py
| Key | Value |
|---|---|
| Change | +18/-13 lines: approve_din(ctx, spender, amount, purpose) extracted from stake_dintokens; stake_dintokens now calls it |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/utils.py
| Key | Value |
|---|---|
| Change | +11 lines: TIER_KINDS dict and parse_tier_kind(tier) helper for T1/T2 enum encoding |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/modelownerd/rewards.py (new)
| Key | Value |
|---|---|
| Change | +104 lines: deposit (approve → depositRewards, defaults to next GI) and fund-emission (DinEmission.fundGI, with pre-flight registry/funded/schedule checks) |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/rewards.py (new)
| Key | Value |
|---|---|
| Change | +63 lines: claim (claimReward for one GI, guards on settled + already-claimed) and withdraw (claimRewards, guards on claimable > 0) for any role |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/modelownerd/gi.py
| Key | Value |
|---|---|
| Change | +39 lines: gi start reward-pool pre-check (before pass-score evaluation); release-slots command (guards on GI ended + not already released) |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/auditor.py
| Key | Value |
|---|---|
| Change | +92/-1 lines: _load_auditor_x25519_key renamed to take address; _auditor_x25519_key_path(address) helper; register-encryption-key command (generate/reuse per-wallet key, chmod 0600, skip if already on-chain); dispute-test-data command (pre-flight checks before approve → openTestDataDispute) |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/modelownerd/auditor_batches.py
| Key | Value |
|---|---|
| Change | +148/-8 lines: _load_owner_x25519_key, _save_testdata_secret, _load_testdata_secret, _auditors_missing_encryption_key, _encrypt_batch_testdata extracted as shared helpers; create-testdataset --submit gains keyless-auditor exit (before any tx) and per-batch secret save (before assign tx); owner key chmod 0600 |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/modelownerd/disputes.py (new)
| Key | Value |
|---|---|
| Change | +277 lines: resolve-test-data, close-expired, reassign-test-data (test-data dispute family); resolve-aggregation (uphold: locks seed first → resolveDispute; reject: direct), settle-recomputation, expire (aggregation dispute family) |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/aggregator.py
| Key | Value |
|---|---|
| Change | +67/-3 lines: dispute (approve DIN bond → openDispute, guards on existing dispute + dinToken set); claim-dispute-bond (guards on disputeBondClaimable > 0) |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/dinrep.py
| Key | Value |
|---|---|
| Change | +38/-5 lines: approve_registration_request gains --force; _task_contract_model_ids reads modelId() from both task contracts (req[3]=coordinator, req[4]=auditor, verified against ModelRequest struct layout); refuses approval on mismatch unless --force |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
dincli/cli/modelowner.py / dincli/main.py
| Key | Value |
|---|---|
| Change | rewards_app and disputes_app wired under model-owner; rewards.app (claim/withdraw) wired at top level |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
tests/_cli_fakes.py (new) / tests/test_rewards_commands.py / tests/test_dispute_commands.py / tests/test_gi_release_slots_and_funding.py / tests/test_auditor_encryption_key.py / tests/test_dinrep_approve_model_id.py / tests/test_create_testdataset_submit.py
| Key | Value |
|---|---|
| Change | +684 lines across 7 files: shared FakeContract/FakeCtxObj/record_txs infrastructure; one test file per command group; pre-tx exit checks throughout; test_command_is_registered covers all 15 new paths via --help |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
tests/test_dintoken.py
| Key | Value |
|---|---|
| Change | +2/-1 lines: dummy get_deployed_din_token_contract updated to accept verbose kwarg |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
Developer/BACK_LOG.md
| Key | Value |
|---|---|
| Change | BL-28: "Fix in review — PR No. 302 adds release-slots"; BL-11 residual note updated: dincli's resolve-aggregation --upheld now locks the seed |
| Pending proposal | None |
| Recommended merge proposal | Merge as-is |
| Actual merge proposal | Soon |
robertocarlous
left a comment
There was a problem hiding this comment.
15 new commands verified: wiring, pre-flight checks, per-wallet key paths, per-batch secret save-before-tx, seed-lock ordering, modelRequests tuple indexing, DinEmission ABI vs source. All 609 tests pass at 15e7afc3. No findings.
Resolve the Developer/BACK_LOG.md conflict: BL-27 takes develop's 'Fixed — PR No. 261' (merged 2026-11-02); BL-28 keeps this PR's 'Fix in review' status, since this PR adds the release-slots command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@robertocarlous, I merged
Once |
robertocarlous
left a comment
There was a problem hiding this comment.
Re-approval at 5e3b99c. Reviewed 15e7afc → 5e3b99c: the only diff is the develop merge commit. BACK_LOG.md conflict resolution verified — BL-27 takes develop's Fixed PR No. 261, BL-28 keeps Fix in review. All 22 PR-specific files (dincli commands, tests, ABIs) byte-for-byte identical to the dismissed approval. CI all 4 green (run 41602129061).
11b22de
…26_21 Part C, Deploy) The deploy follow-up PR InfiniteZeroFoundation#302 deferred until InfiniteZeroFoundation#261 merged: - `model-owner deploy task-coordinator` and `task-auditor` call setDinToken(din_info token) on the new contract. Without it, `rewards deposit` refuses and no GI can be funded or started. - `--model-id` is optional. The coordinator defaults to DINModelRegistry.totalModels() (the ID the next approval assigns) and warns that this only holds if no other request is approved first. The auditor defaults to the coordinator's modelId(); the mismatch guard from InfiniteZeroFoundation#261 is unchanged. - A missing `stake` or `token` din_info entry exits with a clear message before any transaction, instead of a NameError. DINTaskCoordinator.md §10 No. 10 and DINTaskAuditor.md §13 No. 8 now describe the fixed deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
task_061026_21 Part C, PR 2: the dincli commands needed to drive a complete GI on the foundry task contracts. Spec:
Developer/tasks/task_061026_21.md. Tracking: Discussion #231.Closes BL-28 (#223 Part 2). #223 Part 1 (deploy
--model-id) is in #261; see Scope below.New commands
model-owner rewards deposit <model_id> --amount <DIN> [--gi N]approve_din→depositRewardsdinTokenset, balancemodel-owner rewards fund-emission <model_id> [--gi N]DinEmission.fundGI(gi, taskAuditor)rewards claim <model_id> --gi N/rewards withdraw <model_id>claimReward(gi)/claimRewards()giRewardSnapshot(gi).settled,rewardClaimed,claimable > 0auditor register-encryption-keyDinValidatorStake.registerEncryptionKeymodel-owner gi release-slots <model_id> [--gi N]releaseGIRegistrationSlotsauditor dispute-test-data <model_id> --batch Bapprove_din→openTestDataDisputemodel-owner disputes resolve-test-data / close-expired / reassign-test-dataresolveTestDataDispute/closeExpiredDispute/reassignAuditTestDatasetaggregator dispute <model_id> --tier t1|t2 --batch Bapprove_din→openDisputedinTokensetmodel-owner disputes resolve-aggregation --upheld/--rejected,settle-recomputation --confirmed/--dismissed,expireresolveDispute/settleRecomputation/expireDisputelockDisputeSeed, waiting forseedBlock)aggregator claim-dispute-bond <model_id>claimDisputeBonddisputeBondClaimable > 0Fail-fast checks on existing commands
gi startexits ifgiRewardPool(next GI) == 0and points torewards deposit. It checks this before the pass-score evaluation, which needs the test dataset.auditor-batches create-testdataset --submitchecks every batch auditor's key before sending any tx, and names any auditor that hasn't registered one.dinrep registry approve-registration-requestcompares each requested contract'smodelId()withtotalModels()(Decision 2: the check is in dincli) and refuses a mismatch unless--forceis passed.Keys and secrets
auditor_x25519_<checksum address>.key, chmod 600. It replaces the singleauditor_x25519.key, which stopped several--demokeyauditors on one machine from working._load_auditor_x25519_key(address)matches the new layout. An existing shared key isn't migrated: an auditor rerunsregister-encryption-key, which registers a new key.owner_x25519.keyis now chmod 600.create-testdataset --submitandreassign-test-datasave them to<model dir>/audits/testdata_keys/gi_<gi>_batch_<b>.json(chmod 600), before the assign tx goes out.resolve-test-dataneeds them: until now K was never persisted, so the owner had no way to answer a dispute._encrypt_batch_testdata, which assign and reassign share. Its output is unchanged.Reuse
approve_din(ctx, spender, amount)helper comes from the inline approve instake_dintokens, which now uses it. Every bond and deposit command goes through it.build_and_send_txand theget_deployed_din_task_*_contractlookups, as the spec asks.dincli/abis/DinEmission.jsonis generated fromfoundry/outin thedump-abiformat, and there's a newget_deployed_din_emission_contract. All the other bundled ABIs matchfoundry/outon this base.Scope and deviations, for review
Deploy (BL-27, dincli model-owner: deploy sends stale constructor args (broken); no command for releaseGIRegistrationSlots (BL-27, BL-28) #223 Part 1) isn't in this PR. feat(cache_model_0): refresh task-contract ABIs from foundry and fix deploy constructors (BL-25) #261 (robertocarlous) already adds
--model-idand the coordinatormodelId()check todeploy.pyand is close to approval. Doing it here too would conflict. Once feat(cache_model_0): refresh task-contract ABIs from foundry and fix deploy constructors (BL-25) #261 merges, a small follow-up adds the rest of the spec's deploy items:setDinTokenon both contracts--model-idtototalModels()NameErrorfixThe caveats in
DINTaskCoordinator.md§10 No. 10 andDINTaskAuditor.md§13 No. 8 are about deploy, so they wait for that follow-up as well.claim-dispute-bondis underaggregator, notmodel-owner disputes.claimDisputeBondpaysmsg.sender, and only the challenger ever has a balance; a model owner never would.close-expiredandexpirestay undermodel-owner disputes, as the spec lists them. Both are permissionless, so a disputer can run them from there too.reassign-test-datare-runs the owner'screate_audit_testDataCIDsservice and uses only the disputed batch's entry. The service has no single-batch entry point, so it re-uploads every batch with fresh keys; only the reassigned batch's data goes on-chain.Order relative to feat(task-coordinator): re-land richer GI states — AuditSeedLocked, AuditTestDataAssigned, AggSeedLocked (task_061026_21 A+B) #287 (Part B re-land). The spec says Part C goes after B. Nothing here depends on the new states:
create-testdatasetalready handlesAuditTestDataAssigned, and the funding check reads the pool, not the state. Both PRs touchauditor_batches.py, in different hunks, so whichever lands second rebases.Tests
One pytest file per command group, using a shared
tests/_cli_fakes.py(fake contracts plus a monkeypatchedbuild_and_send_txthat records sent calls in order):test_rewards_commands.py: deposit/fund-emission/claim/withdraw, plus a CliRunner--helpcheck for all 15 new command pathstest_auditor_encryption_key.py: one key per wallet, 0600, reuse, skip when already on-chaintest_dispute_commands.py: both dispute families; bond approval comes before the open; the seed is locked before an upheld resolve; window checkstest_gi_release_slots_and_funding.py: release-slots and thegi startfunding checktest_dinrep_approve_model_id.py: refusal on a mismatch,--force, and the matching casetest_create_testdataset_submit.py: the keyless-auditor exit (before any tx), and per-batch secrets plus the owner key saved as 0600test_dintoken.py: its dummyget_deployed_din_token_contractnow takesverbose, like the real method.Not run against a chain. The full-GI integration run is Part D (PR 3).
🤖 Generated with Claude Code